<%@page import="Model.User.UserSupplierPurchaseView"%>
<%@page import="Model.Supplier.SupplierRecommendView"%>
<%@page import="Model.Purchase.PurchaseListView"%>
<%@page import="Model.Purchase.PurchaseList"%>
<%@page import="Model.Banner.BannerList"%>
<%@page import="Model.Product.ProductRecomnendView"%>
<%@page import="Model.Supplier.SupplierList"%>
<%@page import="Model.Supplier.SupplierExcellentView"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>企企通-供应商</title>
        <meta name="description" content="这里写网站内容描述" />
        <meta name="keywords" content="这里写关键词" />
        <meta name="Robots" contect="all">
        <link href="/css/reset.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/head.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/footer.css" rel="stylesheet" type="text/css"/>
        <link href="css/index.css" rel="stylesheet" type="text/css"/>
    </head>
    <body id="gongys">
        <%@include file="/inc/head.jsp" %>
        <!--广告区域-->
        <div id="advert">
            <div id="banner">
                <div id="play">
                    <ul>
                        <%
                            BannerList banner = new BannerList(pageContext);
                            banner.pagesize = 3;
                            banner.select("types,link,imgPath,id").where("types=2").get_page_desc("id");
                            while (banner.for_in_rows()) {
                        %>
                        <li><a href="<%=banner.get("link")%>" target="_blank"><img src="/upfile/<%=banner.get("imgPath")%>" alt=""/></a></li>
                                <% }%> 
                    </ul>
                    <button id="left">&lt;</button>
                    <button id="right">&gt;</button>
                    <ol>
                        <li class="sl"></li>
                        <li></li>
                        <li></li>
                    </ol>
                </div>
            </div>
            <div id="dynamic">
                <p>优秀供应商</p>
                <div>
                    <%
                        SupplierExcellentView sev = new SupplierExcellentView(pageContext);
                        sev.pagesize = 3;
                        sev.select("id,myid,logo,corpname,honesty").get_page_desc("id");
                        while (sev.for_in_rows()) {
                            int score = Integer.parseInt(sev.get("honesty"));
                    %>
                    <div>
                        <a href="/supplier/home/<% sev.write("myid");%>" target="_blank">

                            <img src="/upfile/<%sev.write("logo");%>" alt="企业logo"/> 
                            <p><%=sev.get("corpname")%></p>
                            <span>
                                诚信等级
                                <% for (Integer n = 0; n < score; n++) { %><i></i><% }%>
                            </span>
                        </a>
                    </div>
                    <%  }%>
                </div>
            </div>
        </div>
        <!--供应商排行榜-->
        <div id="rankings">
            <h2>供应商排行榜<a href=""></a></h2>
            <div class="number">
                <h3>参与项目数量排行榜</h3>
                <ol>
                    <%
                        PurchaseListView project = new PurchaseListView(pageContext);
                        UserSupplierPurchaseView uspv1 = new UserSupplierPurchaseView(pageContext);
                        uspv1.pagesize = 10;
                        uspv1.select("myid,corpname,aggregate,num").get_page_desc("num");
                        int i = 0;
                        while (uspv1.for_in_rows()) {
                            i++;
                    %>
                    <li><span><%=i%></span><a href="/supplier/home/<%uspv1.write("myid");%>" target="_blank"><%uspv1.write("corpname");%></a></li>
                            <% }%>
                </ol>
            </div>
            <div id="picture">
                <%
                    SupplierExcellentView supplier = new SupplierExcellentView(pageContext);
                    supplier.pagesize = 14;
                    supplier.select("id,myid,logo").get_page_desc("id");
                    while (supplier.for_in_rows()) {
                        String sr = "";
                        if (supplier.get("logo").equals("")) {
                            sr = "../img/copynyLogo.png";
                        } else {
                            sr = supplier.get("logo");
                        }

                %>
                <a href="/supplier/home/<%supplier.write("myid");%>" target="_blank"><img src="/upfile/<%=sr%>" alt="企业logo"/></a>
                    <% }%>
            </div>
            <div class="number">
                <h3>成交金额排行榜</h3>
                <ol>
                    <%
                        UserSupplierPurchaseView uspv = new UserSupplierPurchaseView(pageContext);
                        uspv.pagesize = 10;
                        int w = 0;
                        uspv.select("myid,corpname,aggregate").get_page_desc("aggregate");
                        while (uspv.for_in_rows()) {
                            w++;
                    %>
                    <li><span><%=w%></span><a href="/supplier/home/<%uspv.write("myid");%>" target="_blank"><%uspv.write("corpname");%></a></li>
                            <% }%>
                </ol>
            </div>
        </div>
        <!--供应商推荐-->
        <div id="recommend">
            <h2>供应商推荐</h2>
            <%
                SupplierRecommendView srv = new SupplierRecommendView(pageContext);
                srv.pagesize = 6;
                srv.select("honesty,myid,logo,corpname,shengid,shiid,xianid,mainproducts,fulladress,mainbusiness").get_page_desc("myid");
                while (srv.for_in_rows()) {
                    int scores = Integer.parseInt(srv.get("honesty"));
            %>
            <div class="details">
                <div>
                    <a href="/supplier/home/<%srv.write("myid");%>"><img src="/upfile/<%=srv.get("logo")%>" alt="企业logo"/></a>
                    <h3><a href="/supplier/home/<%srv.write("myid");%>"><%srv.write("corpname");%></a></h3>
                    <p>
                        诚信等级
                        <span>
                            <% for (int n = 0; n < scores; n++) { %>
                            <img src="../img/huangguan.png"/>
                            <% }%>
                        </span>
                    </p>
                </div>
                <ul>
<!--                    <li>累计成交金额：<span><%srv.write("num");%>万元</span></li>-->
                    <li>所属地区：<span><%srv.write("fulladress");%></span></li>
                    <li>主营类别：<span><%srv.write("mainbusiness");%></span></li>
                </ul>
            </div>
            <% }%>
        </div>
        <!--产品推荐-->
        <div id="product">
            <h2>产品推荐<a href=""></a></h2>
                <%  ProductRecomnendView prod = new ProductRecomnendView(pageContext);
                    prod.pagesize = 8;
                    prod.select("productid,honesty,myid,pt,name,corpname").get_page_desc("productid");
                    while (prod.for_in_rows()) {
                        int score = Integer.parseInt(prod.get("honesty"));
                %>
            <div>
                <a href="/supplier/home/<%prod.write("myid");%>" target="">
                    <img src="/upfile/<%=prod.get("pt")%>" alt="产品图片"/>
                    <p><%prod.write("name");%></p>
                    <h3><em><%prod.write("corpname");%></em>
                        <% for (int x = 0; x < score; x++) {%>
                        <i></i>
                        <% }%>
                    </h3>
                </a>
            </div>
            <% }%>
        </div>
        <%@include file="/inc/footer.jsp" %>
        <%@include file="/inc/js_all.html" %>
        <script src="/js/arealist.js" type="text/javascript"></script>
        <script src="/data/dictdata.js" type="text/javascript"></script>
        <script type="text/javascript">
            dictdata['area'] = AreaListData;
        </script>
        <script src="js/index.js" type="text/javascript"></script>
    </body>
</html>
